<template>
  <div class="empty-data">
    <div class="empty-text" v-if="empty && !loading">{{text}}</div>
    <van-loading class="loading" v-if="empty && loading"></van-loading>
  </div>
</template>
<script>

export default {
  name: 'empty-data',
  props: {
    text: {
      default: '暂无数据'
    },
    empty: {
      type: Boolean,
      default: true
    },
    loading: {
      type: Boolean,
      default: false
    }
  }
}
</script>

<style scoped lang="less">
.empty-data{
  display: block;
  width: 100%;
  .empty-text{
    text-align: center;
    padding: 19px 0 20px;
    font-size: 14px;
    color: #ccc;
  }
  .loading {
    padding: 11px 0 11px;
    margin-left: auto;
    margin-right: auto;
  }
}
</style>
